// *************************************************************************************************
//
// Horde3D
//   Next-Generation Graphics Engine
//
// Sample Application
// --------------------------------------
// Copyright (C) 2006-2011 Nicolas Schulz
//
//
// This sample source file is not covered by the EPL as the rest of the SDK
// and may be used without any restrictions. However, the EPL's disclaimer of
// warranty and liability shall be in effect for this file.
//
// *************************************************************************************************

#ifndef _crowd_H_
#define _crowd_H_

#include "RVO\RVO.h"
#include "Ogre.h"
#include <vector>
#include <string>

struct RoadmapVertex {
	RVO::Vector2 position;
	std::vector<int> neighbors;
	std::vector<float> distToGoal;
};

class CrowdSim
{
public:
	CrowdSim( const std::string& contentDir ) : _contentDir( contentDir ) {}
	RVO::RVOSimulator *sim;
	std::vector<Ogre::SceneNode> nodes;
	void init();
	void update( float fps );
	std::vector<RoadmapVertex> roadmap;
	std::vector<int> goals;
	void updateVisualization(RVO::RVOSimulator* sim);
	void setPreferredVelocities(RVO::RVOSimulator* sim);
	bool reachedGoal(RVO::RVOSimulator* sim);
	void buildRoadmap(RVO::RVOSimulator* sim);
	std::vector<float> animTime;
private:
	std::string              _contentDir;

};

#endif // _crowd_H_
